<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/12/1
 * Time: 15:48
 */
namespace vendor;
use vendor\user\User;
use vendor\user\Vip1;
use vendor\user\Vip2;
use vendor\user\Vip3;

require 'user\User.php';
require 'user\Vip1.php';
require 'user\Vip2.php';
require 'user\Vip3.php';

class manager
{
    private $arr = [];
    public function OpenSite(){
        $this->arr[] = $this->createUser(0);
        $this->arr[] = $this->createUser(0);
        $this->arr[] = $this->createUser(1);
        $this->arr[] = $this->createUser(2);
        $this->arr[] = $this->createUser(3);
    }
    public function CloseSite(){
        echo '关闭网站<br />';
    }
    public function showOnlineNum(){
        echo '<br />在线人数：'.User::getOnlineNum().'<br />';
    }
    private function createUser($level){
        $User = null;
        switch ($level){
            case 0:
                $User = new User();
                break;
            case 1:
                $User = new Vip1();
                break;
            case 2:
                $User = new Vip2();
                break;
            case 3:
                $User = new Vip3();
                break;
        }
        $User->mylevel();
        $this->showOnlineNum();
        return $User;
    }
//普通用户
//    public function createCommonUser(){
//        $user = new User();
//        $user->mylevel();
//        $this->showOnlineNum();
//    }
//VIP1用户
//    public function createVip1User(){
//        $vip1 = new Vip1();
//        $vip1->SubmitPassage();
//        $vip1->mylevel();
//    }
//VIP2用户
//    public function createVip2User(){
//        $vip2 = new Vip2();
//        $vip2->Delpassage();
//        $vip2->mylevel();
//    }
//VIP3用户
//    public function createVip3User(){
//        $vip3 = new Vip3();
//        $vip3->kickOut();
//        $vip3->mylevel();
//    }
}

$manager = new manager();
$manager->OpenSite();
$manager->CloseSite();
//$manager->createCommonUser();
//$manager->createVip1User();
//$manager->createVip2User();
//$manager->createVip3User();


